set(DAQ_VERSION 2.0.0)
add_definitions(-DUSE_DAQ331M)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    set(DAQ_ROOT_PATH "${CMAKE_SOURCE_DIR}/../../../../lib/${CMAKE_SYSTEM_NAME}")
    set(DAQ_ROOT_PATH "${DAQ_ROOT_PATH}/libdaq")
    if(MSVC)
        # msvc2017
        if(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
            if(CMAKE_SIZEOF_VOID_P EQUAL 8)
                set(DAQ_LIB_BIT "x64/msvc2017")
            else()
                set(DAQ_LIB_BIT "x86/msvc2017")
            endif()
        # msvc2019
        elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
            if(CMAKE_SIZEOF_VOID_P EQUAL 8)
                set(DAQ_LIB_BIT "x64/msvc2019")
            else()
                set(DAQ_LIB_BIT "x86/msvc2019")
            endif()
        else()
            message("no support msvc version {MSVC_VERSION}")
        endif()
        set(DAQ_LIBRARIES "${DAQ_ROOT_PATH}/lib/${DAQ_LIB_BIT}/libdaq-${DAQ_VERSION}.lib")
    elseif(CMAKE_COMPILER_IS_GNUCXX)
        if(CMAKE_SIZEOF_VOID_P EQUAL 8)
            set(DAQ_LIB_BIT "x64/mingw810")
        else()
            set(DAQ_LIB_BIT "x86/mingw810")
        endif()
        set(DAQ_LIBRARIES "${DAQ_ROOT_PATH}/lib/${DAQ_LIB_BIT}/liblibdaq-${DAQ_VERSION}.dll.a")
    endif()
    message("${DAQ_LIBRARIES}")
    set(DAQ_THIRD_PARTY_PATH "${DAQ_ROOT_PATH}/third_party")

    set(DAQ_INCLUDE_DIRS "${DAQ_ROOT_PATH}/include" "${DAQ_THIRD_PARTY_PATH}/include")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    set(DAQ_ROOT_PATH "${CMAKE_SOURCE_DIR}/../../../../lib/${CMAKE_SYSTEM_NAME}")
    set(DAQ_ROOT_PATH "${DAQ_ROOT_PATH}/libdaq")
    set(DAQ_THIRD_PARTY_PATH "${DAQ_ROOT_PATH}/third_party")

    set(DAQ_INCLUDE_DIRS "${DAQ_ROOT_PATH}/include" "${DAQ_THIRD_PARTY_PATH}/include")
    set(DAQ_LIBRARIES "${DAQ_ROOT_PATH}/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}/liblibdaq-${DAQ_VERSION}.so")
endif()

INCLUDE_DIRECTORIES(${DAQ_INCLUDE_DIRS})
